package org.jeecg.modules.bigdatashow.controller;

import org.jeecg.modules.bigdatashow.entity.CommonResult;
import org.jeecg.modules.bigdatashow.entity.Common;
import org.jeecg.modules.bigdatashow.entity.TsMonth;
import org.jeecg.modules.bigdatashow.service.MonthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MonthController {
    @Autowired
   private MonthService monthService;

    @GetMapping(value = "/findVisitorMonth",produces = "application/json; charset=utf-8")
   public CommonResult month(){
      List<Common> visitorQuantity  = monthService.findVisitorMonth();
      if (visitorQuantity != null){
          return new CommonResult(200,"中2:各月份的总游客信息为:",visitorQuantity);
      }else {
          return new CommonResult(404,"未查询到各月份的游客信息:");
      }
   }
    @GetMapping(value = "/findTsMonth",produces = "application/json; charset=utf-8")
    public CommonResult findTsMonth(){
        List<TsMonth> TsQuantity  = monthService.findTsMonth();
        if (TsQuantity != null){
            return new CommonResult(200,"中3:各月份的团队散客游客信息为:",TsQuantity);
        }else {
            return new CommonResult(404,"未查询到各月份的游客信息:");
        }
    }
    @GetMapping(value = "/findAllTsMonth",produces = "application/json; charset=utf-8")
    public CommonResult findAllTsMonth(){
        List<TsMonth> AllTsQuantity  = monthService.findAllTsMonth();
        if (AllTsQuantity != null){
            return new CommonResult(200,"左4:各月份的总团队散客游客信息为:",AllTsQuantity);
        }else {
            return new CommonResult(404,"未查询到各月份的游客信息:");
        }
    }
}
